using UnityEngine;

public class VehicleSelectManager : MonoBehaviour
{
	public GameObject panelVehicleSelect;

	public Transform content;

	private ItemVehicleScript[] itemVehicles;

	public ITEM_VEHICLE[] _Vehicle;

	

	public Animator anim;

	private bool hide;

	public void ShowVehicleSelect()
	{
		anim.enabled = true;
		anim.SetTrigger("show");
		anim.gameObject.SetActive(value: true);
		panelVehicleSelect.SetActive(value: true);
	}

	public void HideVehicleSelect()
	{
		anim.enabled = true;
		anim.SetTrigger("hide");
		hide = true;
        if (!AdManager1.instance.ShieldAddress) AdManager.single.ShowNative();
    }

	private void Awake()
	{
		int childCount = content.childCount;
		itemVehicles = new ItemVehicleScript[childCount];
		for (int i = 0; i < childCount; i++)
		{
			itemVehicles[i] = content.GetChild(i).GetComponent<ItemVehicleScript>();
			itemVehicles[i].SetInfo(_Vehicle[i], i);
		}
	}

	public void DisableAnim()
	{
		anim.enabled = false;
		if (hide)
		{
			anim.gameObject.SetActive(value: false);
			hide = false;
		}
	}

	public int CheckStatus()
	{
		int num = 0;
		for (int i = 0; i < itemVehicles.Length; i++)
		{
			num += itemVehicles[i].CheckStatus();
		}
		return num;
	}
}
